<script setup lang="ts">
defineProps({
  title: {
    type: String,
    default: "Loading",
  },
});
</script>

<template>
  <div class="loading">
    <div class="loadingco">
      <h2>{{ title }}</h2>
      <span></span>
      <span></span>
      <span></span>
      <span></span>
      <span></span>
      <span></span>
      <span></span>
    </div>
  </div>
</template>

<style scoped>
.loading {
  width: 100%;
  height: 100%;
  background: #fff;
  position: absolute;
}

.loading .loadingco {
  width: 200px;
  height: 80px;
  text-align: center;
  z-index: 1;
  position: absolute;
  inset: 0;
  margin: auto;
}

.loading h2 {
  color: #666;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 20px;
  font-weight: 400;
  font-family: Arial, Helvetica, sans-serif;
}

.loading span {
  display: inline-block;
  vertical-align: middle;
  width: 0.6em;
  height: 0.6em;
  margin: 0.19em;
  background: #007db6;
  border-radius: 0.6em;
  animation: loading 1s infinite alternate;
  animation: loading 1s infinite alternate;
}

.loading span:nth-of-type(2) {
  background: #008fb2;
  animation-delay: 0.2s;
  animation-delay: 0.2s;
}

.loading span:nth-of-type(3) {
  background: #009b9e;
  animation-delay: 0.4s;
  animation-delay: 0.4s;
}

.loading span:nth-of-type(4) {
  background: #00a77d;
  animation-delay: 0.6s;
  animation-delay: 0.6s;
}

.loading span:nth-of-type(5) {
  background: #00b247;
  animation-delay: 0.8s;
  animation-delay: 0.8s;
}

.loading span:nth-of-type(6) {
  background: #5ab027;
  animation-delay: 1s;
  animation-delay: 1s;
}

.loading span:nth-of-type(7) {
  background: #a0b61e;
  animation-delay: 1.2s;
  animation-delay: 1.2s;
}

@keyframes loading {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes loading {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}
</style>
